package dkr.test;

import java.lang.management.ManagementFactory;

import javax.management.MBeanServer;
import javax.management.ObjectName;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try{
	        // Get the Platform MBean Server
	        MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();

	        // Construct the ObjectName for the MBean we will register
	        ObjectName name = new ObjectName("dikeruan.test:type=Hello");

	        // Create the Hello World MBean
	        Hello mbean = new Hello();

	        // Register the Hello World MBean
	        mbs.registerMBean(mbean, name);

	        // Wait forever
	        System.out.println("Waiting forever...");
	        Thread.sleep(Long.MAX_VALUE);
		}
		catch(Exception e){
			e.printStackTrace();
		}

	}

}
